<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>有关webgl的API</title>
        <script>
            function init(){
                /**
                    * @description 与webgl容器相关的API
                    * @function webglDiv.getContext() 获取webgl上下文
                    * @function gl.viewport(x,y,webglDiv.clientWidth,webglDiv.clientHeight)  webgl平面可视区域设置
                */
               let webglDiv = document.createElement("myCanvas");
               let gl=webglDiv.getContext('webgl')
               gl.viewport(x,y,webglDiv.clientWidth,webglDiv.clientHeight)
            }
      
    </script>
    </head>
    <body>
        <canvas id="myCanvas" width="800" height="800"></canvas>
    </body>
</html>